package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HisEngineRulePrescriptionRightsMapper;
import com.ruoyi.system.domain.HisEngineRulePrescriptionRights;
import com.ruoyi.system.service.IHisEngineRulePrescriptionRightsService;

/**
 * 处方权规则Service业务层处理
 *
 * @author Alan
 * @date 2024-03-07
 */
@Service
public class HisEngineRulePrescriptionRightsServiceImpl implements IHisEngineRulePrescriptionRightsService
{
    @Autowired
    private HisEngineRulePrescriptionRightsMapper hisEngineRulePrescriptionRightsMapper;

    /**
     * 查询处方权规则
     *
     * @param id 处方权规则主键
     * @return 处方权规则
     */
    @Override
    public HisEngineRulePrescriptionRights selectHisEngineRulePrescriptionRightsById(Long id)
    {
        return hisEngineRulePrescriptionRightsMapper.selectHisEngineRulePrescriptionRightsById(id);
    }

    /**
     * 查询处方权规则列表
     *
     * @param hisEngineRulePrescriptionRights 处方权规则
     * @return 处方权规则
     */
    @Override
    public List<HisEngineRulePrescriptionRights> selectHisEngineRulePrescriptionRightsList(HisEngineRulePrescriptionRights hisEngineRulePrescriptionRights)
    {
        return hisEngineRulePrescriptionRightsMapper.selectHisEngineRulePrescriptionRightsList(hisEngineRulePrescriptionRights);
    }

    /**
     * 新增处方权规则
     *
     * @param hisEngineRulePrescriptionRights 处方权规则
     * @return 结果
     */
    @Override
    public int insertHisEngineRulePrescriptionRights(HisEngineRulePrescriptionRights hisEngineRulePrescriptionRights)
    {
        hisEngineRulePrescriptionRights.setCreateTime(DateUtils.getNowDate());
        return hisEngineRulePrescriptionRightsMapper.insertHisEngineRulePrescriptionRights(hisEngineRulePrescriptionRights);
    }

    /**
     * 修改处方权规则
     *
     * @param hisEngineRulePrescriptionRights 处方权规则
     * @return 结果
     */
    @Override
    public int updateHisEngineRulePrescriptionRights(HisEngineRulePrescriptionRights hisEngineRulePrescriptionRights)
    {
        return hisEngineRulePrescriptionRightsMapper.updateHisEngineRulePrescriptionRights(hisEngineRulePrescriptionRights);
    }

    /**
     * 批量删除处方权规则
     *
     * @param ids 需要删除的处方权规则主键
     * @return 结果
     */
    @Override
    public int deleteHisEngineRulePrescriptionRightsByIds(Long[] ids)
    {
        return hisEngineRulePrescriptionRightsMapper.deleteHisEngineRulePrescriptionRightsByIds(ids);
    }

    /**
     * 删除处方权规则信息
     *
     * @param id 处方权规则主键
     * @return 结果
     */
    @Override
    public int deleteHisEngineRulePrescriptionRightsById(Long id)
    {
        return hisEngineRulePrescriptionRightsMapper.deleteHisEngineRulePrescriptionRightsById(id);
    }
}
